/* Title: lcd_i2c_lucas Author: Lucas Lim Date Created: 8/4/2019 Last Modified: 9/4/2019 Purpose: To display text to LCD display module with I2C adaptor. Dispalying first text message and wait for 3 seconds before displaying second message at pre-defeined position */ #include #include LiquidCrystal_I2C lcd(0x3F, 16, 2); // set the LCD address, for a 16 chars and 2 line display void setup() { Wire.begin(); // Initialize the LCD, must be called in order to initialize I2C communication lcd.begin(); // Turn on the backlight lcd.backlight(); } void loop() { // Wait for 3 seconds delay(3000); //will set cursor to first column of first row lcd.setCursor(0, 0); // Print a message to the LCD // Message must be 16 characters length lcd.print("Testing"); // Set cursor to first column of first row lcd.setCursor(0,1); // Print a message to the LCD lcd.print("1234567890123456"); // Wait for 3 seconds delay(3000); // Clear the LCD lcd.clear(); // Set cursor to fourth column of first row lcd.setCursor(3, 0); lcd.print("Lucas Lim"); lcd.setCursor(0,1); lcd.print("Hello, world!"); // Wait for 3 seconds delay(3000); // Clear the LCD lcd.clear(); }